package com.abevi.utils.chunker
{
	import flash.events.Event;
	
	/**
	 * An <code>Event</code> subclass used for tracking the progress
	 * of a <code>Chunker</code>'s processing loop.
	 * 
	 * @author Alex Bevilacqua	 
	 */	
	public class ChunkerProgressEvent extends Event
	{
		/**
		 * @private
		 *  
		 * Constructor of a standard <code>Event</code> subclass
		 * 
		 * @param type
		 * @param bubbles
		 * @param cancelable		 
		 */		
		public function ChunkerProgressEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
		}
				
		/**
		 * Clone the current event instance
		 *  
		 * @return cloned event 		 
		 */		
		override public function clone() : Event
		{
			var event : ChunkerProgressEvent = new ChunkerProgressEvent( type );
			event.position = position;
			event.length   = length;
			
			return event;
		}
				
		/**
		 * The current position of the processing loop 
		 */		
		public var position : uint;
		
		/**
		 * The length of the processing loop 
		 */		
		public var length : uint;
		
		/**
		 * Event enumerator type dispatched while a <code>Chunker</code>
		 * is processing a loop 
		 */		
		public static const PROGRESS : String = "chunkerProgress";
		
		/**
		 * Event enumerator type dispatched when a <code>Chunker</code>
		 * finishes processing a loop 
		 */		
		public static const COMPLETE : String = "chunkerComplete";
		
		/**
		 * Event enumerator type dispatched when a <code>Chunker</code>
		 * has been signalled to cancel processing 
		 */		
		public static const CANCELLED : String = "chunkerCancelled";		
	}
}